package com.forekonw.deom2;

import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入消费金额： ");
        double money = input.nextDouble();
        System.out.println("是否参加优惠换购活动：");
        String b = input.next();
        if ("是".equals(b)){
            System.out.println("1.满50元，加2元换购百事可乐饮料一瓶");
            System.out.println("2.满100元，加3元换购500ml可乐一瓶");
            System.out.println("3.满100元，加10元换购5公斤面粉");
            System.out.println("4.满200元，加10元换购一个苏泊尔炒菜锅");
            System.out.println("5.满200元，加20元可换购fender电吉他");
            System.out.println("请选择： ");
        }else {
            System.out.println("谢谢您的光临");
        }

        int a = input.nextInt();
        if (money >= 50 && money < 100) {
            if (a == 1) {
                money += 2;
                System.out.println("成功换购：百事可乐一瓶");
            } else {
                System.out.println("您未参加活动");
            }
            //1
        } else if (money >= 100 && money < 200) {
            if (a == 2) {
                money += 3;
                System.out.println("成功换购：500ml可乐一瓶");
            } else if (a == 1) {
                money += 2;
                System.out.println("成功换购：百事可乐一瓶");
            }
            //2
        } else if (money >= 100 && money < 200) {
            if (a == 3) {
                money += 10;
                System.out.println("成功换购：5公斤面粉");
            } else if (a == 1) {
                money += 2;
                System.out.println("成功换购：百事可乐一瓶");
            } else if (a == 2) {
                money += 3;
                System.out.println("成功换购：500ml可乐一瓶");
            }
            //3

        } else if (money >= 200) {
            if (a == 4) {
                money += 10;
                System.out.println("成功换购：苏泊尔炒菜锅一个");
            } else if (a == 3) {
                money += 10;
                System.out.println("成功换购：5公斤面粉");
            } else if (a == 1) {
                money += 2;
                System.out.println("成功换购：百事可乐一瓶");
            } else if (a == 2) {
                money += 3;
                System.out.println("成功换购：500ml可乐一瓶");
                //4

            } else if (money >= 200) {
                if (a == 5) {
                    money += 20;
                    System.out.println("成功换购: fender电吉他");
                } else if (a == 4) {
                    money += 10;
                    System.out.println("成功换购：苏泊尔炒菜锅一个");
                } else if (a == 3) {
                    money += 10;
                    System.out.println("成功换购：5公斤面粉");
                } else if (a == 1) {
                    money += 2;
                    System.out.println("成功换购：百事可乐一瓶");
                } else if (a == 2) {
                    money += 3;
                    System.out.println("成功换购：500ml可乐一瓶");
                }
//                else if (money < 50){
//                    System.out.println("您不能参加换购");
//                }
                //5
            } else {
                //未换购
                System.out.println("未换购，期待您下次光临");
            }
            System.out.println("本次消费总金额为：" + money);
        }
    }
}